<?php
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-lr-10">
  <form name="myform" action="?m=shop&c=shop_admin&a=listorder" method="post">
  <div class="table-list">
    <?php ?>
    <table width="100%" cellspacing="0">
      <thead>
        <tr>
          <th width="35" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('sid[]');"></th>
          <th width="40" align="center"><?php echo L('sid')?></th>
          <th align="center"><?php echo L('goodsname')?></th>
          <th width='60' align="center"><?php echo L('goodsnum')?></th>
          <th align="center" width="150"><?php echo L('ordersn')?></th>
          <th align="center" width="150"><?php echo L('tradeno')?></th>
          <th width="80" align="center"><?php echo L('goodprice')?></th>
          <th width='50' align="center"><?php echo L('pay_status')?></th>
          <th width='120' align="center"><?php echo L('addtime')?></th>
          <th width='120' align="center"><?php echo L('content')?></th>
          <th width="120" align="center"><?php echo L('operations_manage')?></th>
        </tr>
      </thead>
      <tbody>
        <?php
        if(is_array($data)){
          foreach($data as $shop){?>
          <tr>
            <td align="center"><input type="checkbox" name="sid[]" value="<?php echo $shop['sid']?>"></td>
            <td align="center"><?php echo $shop['sid']?></td>
            <td><?php echo $shop['goodsname']?></td>
            <td align="center"><?php echo $shop['goodscatid'].'-'.$shop['goodsid']?></td>
            <td align="center"><?php echo $shop['ordersn']?></td>
            <td align="center" style="color:blue"><?php echo $shop['tradeno']?></td>
            <td align="center"><?php echo $shop['goodsprice']?></td>
            <td align="center"><?php echo ($shop['status']) ? '<span style="color:green">已支付</span>' : '<span style="color:red">未支付</span>';?></td>
            <td align="center" title="<?php echo date('Y-m-d H:m:s', $shop['addtime'])?>"><?php echo date('Y-m-d', $shop['addtime'])?></td>
            <td align="center"><?php echo $shop['content']?></td>
            <td align="center">
            <a href="javascript:apply('<?php echo $shop['sid']?>', '<?php echo safe_replace($shop['goodsname'])?>');void(0);">确认收款</a>
            </td>
          </tr>
          <?php
          }
        }?>
      </tbody>
    </table>
    <div class="btn">
      <label for="check_box"><?php echo L('selected_all')?>/<?php echo L('cancel')?></label>&nbsp;
      <button type="submit" name="delete" class="button" onClick="document.myform.action='?m=shop&c=shop_admin&a=delete';return confirm('<?php echo L('affirm_delete')?>')"><?php echo L('remove_all_selected')?></button>&nbsp;
    </div>
    <div id="pages"><?php echo $this->db->pages;?></div>
  </form>
</div>
</body>
</html>
<script type="text/javascript">
// 关闭内容管理菜单
window.top.$('#display_center_id').css('display','none');

function apply(id, title){
  window.top.art.dialog({id:'apply'}).close();
  window.top.art.dialog({
    title:'确认付款--'+title,
    id:'apply',
    iframe:'?m=shop&c=shop_admin&a=apply&sid='+id,
    width:'700px',
    height:'310px'},
    function(){
      var d = window.top.art.dialog({id:'apply'}).data.iframe;
  	  d.document.getElementById('dosubmit').click();
      // form.click();
      return false;
    },
    function(){
      window.top.art.dialog({id:'apply'}).close();
    }
  );
}
</script>
